home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / term / extras / source / term-source.lha / gtlayout.h < prev    next >
C/C++ Source or Header  |  1995-05-02  |  25KB  |  719 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1995 by Olaf `Olsen' Barthel
  5. **    Freely distributable.
  6. */
  7.  
  8. #ifndef _GTLAYOUT_H
  9. #define _GTLAYOUT_H
  10.  
  11.  
  12. /*****************************************************************************/
  13.  
  14.  
  15. #if !defined(_GTLAYOUT_GLOBAL_H) && !defined(SHARED_LIB) && !defined(LINK_LIB)
  16. #define SHARED_LIB 1
  17. #endif
  18.  
  19. #ifdef _DCC
  20. #ifndef __stdargs
  21. #define __stdargs __stkargs
  22. #endif    // __stdargs
  23. #ifndef __asm
  24. #define __asm __regargs
  25. #endif    // __asm
  26. #endif    // _DCC
  27.  
  28. #ifdef _GTLAYOUT_GLOBAL_H
  29. #define REG(x)    register __ ## x
  30. #define LIBENT    __asm __saveds
  31. #endif    // _GTLAYOUT_GLOBAL_H
  32.  
  33. #ifdef SHARED_LIB
  34. #define REG(x)
  35. #define LIBENT
  36. #endif    // SHARED_LIB
  37.  
  38. #ifdef LINK_LIB
  39. #define REG(x)
  40. #define LIBENT    __regargs
  41. #endif    // LINK_LIB
  42.  
  43.  
  44. /*****************************************************************************/
  45.  
  46.  
  47. #ifndef EXEC_TYPES_H
  48. #include <exec/types.h>
  49. #endif
  50.  
  51. #ifndef INTUITION_INTUITION_H
  52. #include <intuition/intuition.h>
  53. #endif
  54.  
  55. #ifndef UTILITY_TAGITEM_H
  56. #include <utility/tagitem.h>
  57. #endif
  58.  
  59. #ifndef INTUITION_GADGETCLASS_H
  60. #include <intuition/gadgetclass.h>
  61. #endif
  62.  
  63. #ifndef LIBRARIES_GADTOOLS_H
  64. #include <libraries/gadtools.h>
  65. #endif
  66.  
  67.  
  68. /*****************************************************************************/
  69.  
  70.  
  71. typedef enum PlacementTypes
  72. {
  73.     PLACE_LEFT,
  74.     PLACE_RIGHT,
  75.     PLACE_ABOVE,
  76.     PLACE_IN,
  77.     PLACE_BELOW
  78. } PlacementTypes;
  79.  
  80. typedef enum AlignmentTypes
  81. {
  82.     ALIGNTEXT_LEFT,
  83.     ALIGNTEXT_CENTERED,
  84.     ALIGNTEXT_RIGHT,
  85.     ALIGNTEXT_PAD
  86. } AlignmentTypes;
  87.  
  88. typedef enum TapeDeckButtonTypes
  89. {
  90.     TDBT_BACKWARD,
  91.     TDBT_FORWARD,
  92.     TDBT_PREVIOUS,
  93.     TDBT_NEXT,
  94.     TDBT_STOP,
  95.     TDBT_PAUSE,
  96.     TDBT_RECORD,
  97.     TDBT_REWIND,
  98.     TDBT_EJECT,
  99.     TDBT_PLAY,
  100.  
  101.     TDBTLAST
  102. } TapeDeckButtonTypes;
  103.  
  104. typedef LONG (* __stdargs DISPFUNC)(struct Gadget *gad,WORD value);
  105.  
  106. #define ALIGNF_RIGHT        (1 << 0)
  107. #define ALIGNF_LEFT        (1 << 1)
  108. #define ALIGNF_TOP        (1 << 2)
  109. #define ALIGNF_BOTTOM        (1 << 3)
  110. #define ALIGNF_EXTRA_RIGHT    (1 << 4)
  111. #define ALIGNF_EXTRA_LEFT    (1 << 5)
  112. #define ALIGNF_EXTRA_TOP    (1 << 6)
  113. #define ALIGNF_EXTRA_BOTTOM    (1 << 7)
  114.  
  115.  
  116. /*****************************************************************************/
  117.  
  118.  
  119. /* Generic tags, applicable for several object types */
  120. #define LA_Chars        TAG_USER+2
  121. #define LA_LabelPlace        TAG_USER+3
  122. #define LA_ExtraSpace        TAG_USER+4
  123. #define LA_NoKey        TAG_USER+30
  124. #define LA_HighLabel        TAG_USER+31
  125. #define LA_LabelText        TAG_USER+37
  126. #define LA_LabelID        TAG_USER+38
  127. #define LA_ID            TAG_USER+39
  128. #define LA_Type            TAG_USER+40
  129. #define LA_PageSelector        TAG_USER+79
  130. #define LA_LabelChars        TAG_USER+107
  131.  
  132. /* Storage type tags */
  133. #define STORE_BYTE        TAG_USER+63
  134. #define LA_BYTE            TAG_USER+63
  135. #define STORE_UBYTE        TAG_USER+64
  136. #define LA_UBYTE        TAG_USER+64
  137. #define STORE_WORD        TAG_USER+65
  138. #define LA_WORD            TAG_USER+65
  139. #define STORE_BOOL        TAG_USER+65
  140. #define LA_BOOL            TAG_USER+65
  141. #define STORE_UWORD        TAG_USER+66
  142. #define LA_UWORD        TAG_USER+66
  143. #define STORE_LONG        TAG_USER+67
  144. #define LA_LONG            TAG_USER+67
  145. #define STORE_ULONG        TAG_USER+68
  146. #define LA_ULONG        TAG_USER+68
  147. #define STORE_STRPTR        TAG_USER+69
  148. #define LA_STRPTR        TAG_USER+69
  149. #define STORE_FRACTION        TAG_USER+68
  150. #define LA_FRACTION        TAG_USER+68
  151.  
  152. /* for use with LT_GetAttributes() only */
  153. #define LA_Left            TAG_USER+16
  154. #define LA_Top            TAG_USER+17
  155. #define LA_Width        TAG_USER+18
  156. #define LA_Height        TAG_USER+19
  157. #define LA_LabelLeft        TAG_USER+114
  158. #define LA_LabelTop        TAG_USER+115
  159.  
  160. /* TEXT_KIND */
  161. #define LATX_Picker        TAG_USER+5
  162. #define LATX_UsePicker        TAG_USER+5
  163. #define LATX_LockSize        TAG_USER+106
  164.  
  165. /* VERTICAL_KIND, HORIZONTAL_KIND */
  166. #define LAGR_Spread        TAG_USER+6
  167. #define LAGR_SameSize        TAG_USER+8
  168. #define LAGR_LastAttributes    TAG_USER+46
  169. #define LAGR_ActivePage        TAG_USER+58
  170. #define LAGR_Frame        TAG_USER+104
  171. #define LAGR_IndentX        TAG_USER+130
  172. #define LAGR_IndentY        TAG_USER+134
  173.  
  174. /* FRAME_KIND */
  175. #define LAFR_InnerWidth        TAG_USER+9
  176. #define LAFR_InnerHeight    TAG_USER+10
  177. #define LAFR_DrawBox        TAG_USER+11
  178. #define LAFR_RefreshHook    TAG_USER+117
  179.  
  180. /* BOX_KIND */
  181. #define LABX_Labels        TAG_USER+12
  182. #define LABX_Lines        TAG_USER+13
  183. #define LABX_Rows        TAG_USER+1
  184. #define LABX_Index        TAG_USER+14
  185. #define LABX_Text        TAG_USER+15
  186. #define LABX_AlignText        TAG_USER+27
  187. #define LABX_DrawBox        TAG_USER+11
  188. #define LABX_FirstLabel        TAG_USER+44
  189. #define LABX_LastLabel        TAG_USER+45
  190. #define LABX_ReserveSpace    TAG_USER+72
  191. #define LABX_LabelTable        TAG_USER+98
  192.  
  193. /* FRACTION_KIND */
  194. #define LAFC_MaxChars        TAG_USER+20
  195. #define LAFC_Number        TAG_USER+21
  196. #define LAFC_LastGadget        TAG_USER+28
  197. #define LAFC_Min        TAG_USER+23
  198. #define LAFC_Max        TAG_USER+24
  199. #define LAFC_HistoryLines    TAG_USER+59
  200. #define LAFC_HistoryHook    TAG_USER+80
  201.  
  202. /* SLIDER_KIND */
  203. #define LASL_FullCheck        TAG_USER+22
  204.  
  205. /* LISTVIEW_KIND */
  206. #define LALV_ExtraLabels    TAG_USER+26
  207. #define LALV_Labels        TAG_USER+33
  208. #define LALV_CursorKey        TAG_USER+35
  209. #define LALV_Lines        TAG_USER+1
  210. #define LALV_Link        TAG_USER+7
  211. #define LALV_FirstLabel        TAG_USER+44
  212. #define LALV_LastLabel        TAG_USER+45
  213. #define LALV_MaxGrowX        TAG_USER+77
  214. #define LALV_MaxGrowY        TAG_USER+78
  215. #define LALV_LabelTable        TAG_USER+98
  216. #define LALV_LockSize        TAG_USER+106
  217. #define LALV_ResizeX        TAG_USER+109
  218. #define LALV_ResizeY        TAG_USER+110
  219. #define LALV_MinChars        TAG_USER+111
  220. #define LALV_MinLines        TAG_USER+112
  221. #define LALV_FlushLabelLeft    TAG_USER+113
  222. #define LALV_TextAttr        TAG_USER+138
  223.  
  224. /* INTEGER_KIND */
  225. #define LAIN_LastGadget        TAG_USER+28
  226. #define LAIN_Min        TAG_USER+23
  227. #define LAIN_Max        TAG_USER+24
  228. #define LAIN_UseIncrementers    TAG_USER+57
  229. #define LAIN_Incrementers    TAG_USER+57
  230. #define LAIN_HistoryLines    TAG_USER+59
  231. #define LAIN_HistoryHook    TAG_USER+80
  232. #define LAIN_IncrementerHook    TAG_USER+85
  233.  
  234. /* STRING_KIND */
  235. #define LAST_LastGadget        TAG_USER+28
  236. #define LAST_Link        TAG_USER+7
  237. #define LAST_Picker        TAG_USER+5
  238. #define LAST_UsePicker        TAG_USER+5
  239. #define LAST_HistoryLines    TAG_USER+59
  240. #define LAST_HistoryHook    TAG_USER+80
  241. #define LAST_CursorPosition    TAG_USER+105
  242.  
  243. /* PASSWORD_KIND */
  244. #define LAPW_String             GTST_String
  245. #define LAPW_LastGadget        TAG_USER+28
  246. #define LAPW_HistoryLines    TAG_USER+59
  247. #define LAPW_HistoryHook    TAG_USER+80
  248.  
  249. /* PALETTE_KIND */
  250. #define LAPA_SmallPalette    TAG_USER+32
  251. #define LAPA_Lines        LA_Lines
  252. #define LAPA_UsePicker        TAG_USER+137
  253. #define LAPA_Picker        TAG_USER+137
  254.  
  255. /* BUTTON_KIND */
  256. #define LABT_ReturnKey        TAG_USER+34
  257. #define LABT_EscKey        TAG_USER+56
  258. #define LABT_ExtraFat        TAG_USER+29
  259. #define LABT_Lines        TAG_USER+140
  260. #define LABT_FirstLine        TAG_USER+44
  261. #define LABT_LastLine        TAG_USER+45
  262.  
  263. /* GAUGE_KIND */
  264. #define LAGA_Percent        TAG_USER+36
  265. #define LAGA_InfoLength        TAG_USER+70
  266. #define LAGA_InfoText        TAG_USER+71
  267. #define LAGA_NoTicks        TAG_USER+143
  268.  
  269. /* CYCLE_KIND */
  270. #define LACY_FirstLabel        TAG_USER+44
  271. #define LACY_LastLabel        TAG_USER+45
  272. #define LACY_LabelTable        TAG_USER+98
  273. #define LACY_AutoPageID        TAG_USER+103
  274. #define LACY_TabKey        TAG_USER+118
  275.  
  276. /* LEVEL_KIND */
  277. #define LAVL_Min        GTSL_Min
  278. #define LAVL_Max        GTSL_Max
  279. #define LAVL_Level        GTSL_Level
  280. #define LAVL_LevelFormat    GTSL_LevelFormat
  281. #define LAVL_LevelPlace        GTSL_LevelPlace
  282. #define LAVL_DispFunc        GTSL_DispFunc
  283. #define LAVL_FullCheck        LASL_FullCheck
  284.  
  285. /* MX_KIND */
  286. #define LAMX_FirstLabel        TAG_USER+44
  287. #define LAMX_LastLabel        TAG_USER+45
  288. #define LAMX_LabelTable        TAG_USER+98
  289. #define LAMX_TabKey        TAG_USER+118
  290.  
  291. /* SCROLLER_KIND */
  292. #define LASC_Thin        TAG_USER+62
  293.  
  294. /* XBAR_KIND */
  295. #define LAXB_FullSize        TAG_USER+50
  296.  
  297. /* TAPEDECK_KIND */
  298. #define LATD_ButtonType        TAG_USER+86
  299. #define LATD_Toggle        TAG_USER+87
  300. #define LATD_Pressed        TAG_USER+88
  301. #define LATD_Smaller        TAG_USER+89
  302. #define LATD_Tick        TAG_USER+139
  303.  
  304. /* MX_KIND */
  305. #define LAMX_AutoPageID        TAG_USER+103
  306.  
  307. /* BOOPSI_KIND */
  308. #define LABO_TagCurrent        TAG_USER+119
  309. #define LABO_TagTextAttr    TAG_USER+120
  310. #define LABO_TagDrawInfo    TAG_USER+121
  311. #define LABO_TagLink        TAG_USER+129
  312. #define LABO_TagScreen        TAG_USER+132
  313. #define LABO_Link        LALV_Link
  314. #define LABO_ClassInstance    TAG_USER+122
  315. #define LABO_ClassName        TAG_USER+123
  316. #define LABO_ClassLibraryName    TAG_USER+124
  317. #define LABO_ExactWidth        TAG_USER+127
  318. #define LABO_ExactHeight    TAG_USER+128
  319. #define LABO_RelFontHeight    TAG_USER+131
  320. #define LABO_Object        TAG_USER+133
  321. #define LABO_FullWidth        TAG_USER+135
  322. #define LABO_FullHeight        TAG_USER+136
  323. #define LABO_ActivateHook    TAG_USER+141
  324.  
  325. /* Applicable for window only */
  326. #define LAWN_Menu        TAG_USER+25
  327. #define LAWN_UserPort        TAG_USER+47
  328. #define LAWN_Left        TAG_USER+48
  329. #define LAWN_Top        TAG_USER+49
  330. #define LAWN_Zoom        TAG_USER+50
  331. #define LAWN_MaxPen        TAG_USER+52
  332. #define LAWN_BelowMouse        TAG_USER+53
  333. #define LAWN_MoveToWindow    TAG_USER+54
  334. #define LAWN_AutoRefresh    TAG_USER+55
  335. #define LAWN_HelpHook        TAG_USER+73
  336. #define LAWN_Parent        TAG_USER+81
  337. #define LAWN_BlockParent    TAG_USER+82
  338. #define LAWN_SmartZoom        TAG_USER+91
  339. #define LAWN_Title        TAG_USER+92
  340. #define LAWN_TitleText        TAG_USER+92
  341. #define LAWN_Bounds        TAG_USER+93
  342. #define LAWN_ExtraWidth        TAG_USER+94
  343. #define LAWN_ExtraHeight    TAG_USER+95
  344. #define LAWN_IDCMP        TAG_USER+96
  345. #define LAWN_AlignWindow    TAG_USER+97
  346. #define LAWN_TitleID        TAG_USER+99
  347. #define LAWN_FlushLeft        TAG_USER+14000    // NOTEZ-BIEN: TAG_USER+99 = WA_Dummy and can clash
  348. #define LAWN_FlushTop        TAG_USER+14001    //             with Intuition!
  349. #define LAWN_Show        TAG_USER+14002
  350. #define LAWN_MenuTemplate    TAG_USER+14003
  351. #define LAWN_MenuTags        TAG_USER+14004
  352.  
  353. /* Applicable for menus only. */
  354. #define LAMN_FirstLabel        LABX_FirstLabel
  355. #define LAMN_LastLabel        LABX_LastLabel
  356. #define LAMN_LabelTable        TAG_USER+98
  357.  
  358. #define LAMN_TitleText        (TAG_USER + 17000)
  359. #define LAMN_TitleID        (TAG_USER + 17001)
  360. #define LAMN_ItemText        (TAG_USER + 17002)
  361. #define LAMN_ItemID        (TAG_USER + 17003)
  362. #define LAMN_SubText        (TAG_USER + 17004)
  363. #define LAMN_SubID        (TAG_USER + 17005)
  364. #define LAMN_KeyText        (TAG_USER + 17006)
  365. #define LAMN_KeyID        (TAG_USER + 17007)
  366. #define LAMN_CommandText    (TAG_USER + 17008)
  367. #define LAMN_CommandID        (TAG_USER + 17009)
  368. #define LAMN_MutualExclude    (TAG_USER + 17010)
  369. #define LAMN_UserData        (TAG_USER + 17011)
  370. #define LAMN_Disabled        (TAG_USER + 17012)
  371. #define LAMN_CheckIt        (TAG_USER + 17013)
  372. #define LAMN_Checked        (TAG_USER + 17014)
  373. #define LAMN_Toggle        (TAG_USER + 17015)
  374. #define LAMN_Code        (TAG_USER + 17016)
  375. #define LAMN_Qualifier        (TAG_USER + 17017)
  376. #define LAMN_Char        (TAG_USER + 17018)
  377. #define LAMN_ID            (TAG_USER + 17019)
  378. #define LAMN_AmigaGlyph        (TAG_USER + 17020)
  379. #define LAMN_CheckmarkGlyph    (TAG_USER + 17021)
  380. #define LAMN_Error        (TAG_USER + 17022)
  381. #define LAMN_Screen        (TAG_USER + 17023)
  382. #define LAMN_TextAttr        (TAG_USER + 17024)
  383. #define LAMN_LayoutHandle    (TAG_USER + 17025)
  384. #define LAMN_Handle        (TAG_USER + 17025)
  385.  
  386. /* Applicable for layout handle only */
  387. #define LH_Font            TAG_USER+41
  388. #define LH_AutoActivate        TAG_USER+42
  389. #define LH_LocaleHook        TAG_USER+4
  390. #define LH_CloningPermitted    TAG_USER+61
  391. #define LH_EditHook        TAG_USER+74
  392. #define LH_ExactClone        TAG_USER+75
  393. #define LH_MenuGlyphs        TAG_USER+76
  394. #define LH_Parent        TAG_USER+83
  395. #define LH_BlockParent        TAG_USER+84
  396. #define LH_SimpleClone        TAG_USER+90
  397. #define LH_ExitFlush        TAG_USER+108
  398. #define LH_UserData        TAG_USER+116
  399. #define LH_RawKeyFilter        TAG_USER+142
  400.  
  401. /* Private tags; do not use, or you'll run into trouble! */
  402. #define LA_Private1        TAG_USER+100
  403. #define LA_Private2        TAG_USER+101
  404.  
  405. /* Last tag item value used */
  406. #define LAST_TAG        TAG_USER+143
  407.  
  408.  
  409. /*****************************************************************************/
  410.  
  411.  
  412. /* Identifies the absence of a link for a listview or a string gadget */
  413. #define NIL_LINK        -2
  414.  
  415.  
  416. /*****************************************************************************/
  417.  
  418.  
  419.     /* String gadget type history hook support: you will either get
  420.      * the following value passed as the message parameter to your
  421.      * hook function, or a pointer to a null-terminated string you should
  422.      * copy and create a Node from, which you should then add to the tail
  423.      * of your history list. Place a pointer to your history list in the
  424.      * Hook.h_Data entry.
  425.      */
  426.  
  427. #define HISTORYHOOK_DISCARD_OLDEST    0    // Discard oldest entry
  428.  
  429.  
  430. /*****************************************************************************/
  431.  
  432.  
  433.     /* Refresh hook support: you will get the following structure
  434.      * passed as the message and a pointer to the LayoutHandle as
  435.      * the object.
  436.      */
  437.  
  438. typedef struct RefreshMsg
  439. {
  440.     LONG    ID;
  441.     WORD    Left,
  442.         Top,
  443.         Width,
  444.         Height;
  445. } RefreshMsg;
  446.  
  447. /*****************************************************************************/
  448.  
  449.  
  450.     /* Incrementer hook support: you will get the current value
  451.      * passed as the object and one of the following values as
  452.      * the message. Return the number to be used.
  453.      */
  454.  
  455. typedef enum IncrementerMsgTypes
  456. {
  457.     INCREMENTERMSG_DECREMENT = -1,    // Decrement value
  458.     INCREMENTERMSG_INITIAL   =  0,    // Initial value passed upon gadget creation
  459.     INCREMENTERMSG_INCREMENT =  1    // Increment value
  460. } IncrementerMsgTypes;
  461.  
  462.  
  463. /*****************************************************************************/
  464.  
  465.     /* Help key hook support: the hook will be called with a "struct IBox *"
  466.      * as the object and a "struct HelpMsg *". The IBox describes the object
  467.      * the mouse was positioned over, such as a button, a listview, etc.
  468.      * The "ObjectID" will indicate the ID of the object the mouse was
  469.      * positioned over. The ID will be -1 if no object was to be found.
  470.      */
  471.  
  472. typedef struct HelpMsg
  473. {
  474.     struct LayoutHandle    *Handle;    // Window layout handle
  475.     LONG             ObjectID;    // ID of the object, -1 for full window
  476. } HelpMsg;
  477.  
  478.  
  479. /*****************************************************************************/
  480.  
  481.  
  482. /* Obsolete tags, don't use in new code */
  483. #define LA_Lines        LABX_Rows
  484. #define LA_Spread        LAGR_Spread
  485. #define LA_SameSize        LAGR_SameSize
  486. #define LA_FullCheck        LASL_FullCheck
  487. #define LA_ExtraLabels        LALV_ExtraLabels
  488. #define LA_LastGadget        LAFC_LastGadget
  489. #define LA_SmallPalette        LAPA_SmallPalette
  490. #define LA_Labels        LALV_Labels
  491. #define LA_Picker        LATX_Picker
  492. #define LA_DrawBox        LAFR_DrawBox
  493. #define LA_FirstLabel        LABX_FirstLabel
  494. #define LA_LastLabel        LABX_LastLabel
  495. #define LA_LabelTable        LABX_LabelTable
  496. #define LA_Min            LAFC_Min
  497. #define LA_Max            LAFC_Max
  498. #define LA_Link            LALV_Link
  499. #define LA_Menu            LAWN_Menu
  500. #define LA_HistoryLines        LAST_HistoryLines
  501. #define LA_HistoryHook        LAST_HistoryHook
  502. #define LA_ReturnKey        LABT_ReturnKey
  503. #define LA_ExtraFat        LABT_ExtraFat
  504. #define LA_CursorKey        LALV_CursorKey
  505.  
  506.  
  507. /*****************************************************************************/
  508.  
  509.  
  510. /* kinds of objects supported in addition to the normal GadTools kinds */
  511. #define HORIZONTAL_KIND        45
  512. #define VERTICAL_KIND        46
  513. #define END_KIND        47
  514. #define FRAME_KIND        48
  515. #define BOX_KIND        49
  516. #define FRACTION_KIND        50
  517. #define XBAR_KIND        51
  518. #define YBAR_KIND        52
  519. #define PASSWORD_KIND        53
  520. #define GAUGE_KIND        54
  521. #define TAPEDECK_KIND        55
  522. #define LEVEL_KIND        56
  523. #define BOOPSI_KIND        57
  524.  
  525.  
  526. /*****************************************************************************/
  527.  
  528.  
  529. /* in support of FRACTION_KIND gadgets */
  530.  
  531. typedef ULONG            FIXED;
  532. #define FIXED_UNITY        10000
  533.  
  534. #define TO_FIXED(l,r)        (FIXED_UNITY * (l) + (r))
  535. #define FIXED_LEFT(f)        ((f) / FIXED_UNITY)
  536. #define FIXED_RIGHT(f)        ((f) % FIXED_UNITY)
  537.  
  538.  
  539. /*****************************************************************************/
  540.  
  541.  
  542. #ifndef _GTLAYOUT_GLOBAL_H
  543. typedef struct LayoutHandle
  544. {
  545.     struct Screen        *Screen;
  546.     struct DrawInfo        *DrawInfo;
  547.     struct Window        *Window;
  548.     APTR             VisualInfo;
  549.     struct Image        *AmigaGlyph,
  550.                 *CheckGlyph;
  551.     APTR             UserData;    // Requires gtlayout.library v9
  552.     struct Menu        *Menu;        // Requires gtlayout.library v13
  553.     /* private fields follow.... */
  554. } LayoutHandle;
  555. #endif    // _GTLAYOUT_GLOBAL_H
  556.  
  557.  
  558. /*****************************************************************************/
  559.  
  560.  
  561. VOID LIBENT            LT_LevelWidth(REG(a0) struct LayoutHandle *handle,REG(a1) STRPTR levelFormat,REG(a2) DISPFUNC dispFunc,REG(d0) LONG min,REG(d1) LONG max,REG(a3) LONG *maxWidth,REG(a5) LONG *maxLen,REG(d2) BOOL fullCheck);
  562. VOID LIBENT            LT_NewLevelWidth(REG(a0) struct LayoutHandle *handle,REG(a1) STRPTR levelFormat,REG(a2) DISPFUNC dispFunc,REG(d0) LONG min,REG(d1) LONG max,REG(a3) LONG *maxWidth,REG(d3) LONG *maxLen,REG(d2) BOOL fullCheck);
  563. VOID LIBENT            LT_DeleteHandle(REG(a0) struct LayoutHandle *Handle);
  564. struct LayoutHandle * LIBENT    LT_CreateHandle(REG(a0) struct Screen *Screen,REG(a1) struct TextAttr *Font);
  565. struct LayoutHandle * LIBENT    LT_CreateHandleTagList(REG(a0) struct Screen *Screen,REG(a1) struct TagItem *TagList);
  566. BOOL LIBENT            LT_RebuildTagList(REG(a0) struct LayoutHandle *handle,REG(d0) BOOL clear,REG(a1) struct TagItem *TagParams);
  567. VOID LIBENT            LT_HandleInput(REG(a0) struct LayoutHandle *Handle,REG(d0) ULONG MsgQualifier,REG(a1) ULONG *MsgClass,REG(a2) UWORD *MsgCode,REG(a3) struct Gadget **MsgGadget);
  568. VOID LIBENT            LT_BeginRefresh(REG(a0) struct LayoutHandle *handle);
  569. VOID LIBENT            LT_EndRefresh(REG(a0) struct LayoutHandle *handle,REG(d0) BOOL complete);
  570. LONG LIBENT            LT_GetAttributesA(REG(a0) struct LayoutHandle *Handle,REG(d0) LONG ID,REG(a1) struct TagItem *TagList);
  571. VOID LIBENT            LT_SetAttributesA(REG(a0) struct LayoutHandle *handle,REG(d0) LONG id,REG(a1) struct TagItem *TagList);
  572. VOID LIBENT            LT_NewA(REG(a0) struct LayoutHandle *handle,REG(a1) struct TagItem *tagList);
  573. VOID LIBENT            LT_EndGroup(REG(a0) struct LayoutHandle *handle);
  574. struct Window * LIBENT        LT_BuildA(REG(a0) struct LayoutHandle *Handle,REG(a1) struct TagItem *TagParams);
  575. struct Menu * LIBENT        LT_LayoutMenusA(REG(a0) struct LayoutHandle *handle,REG(a1) struct NewMenu *menuTemplate,REG(a2) struct TagItem *TagParams);
  576. VOID LIBENT            LT_Fixed2String(REG(d0) FIXED fixed,REG(d1) STRPTR buffer);
  577. FIXED LIBENT            LT_String2Fixed(REG(a0) STRPTR buffer);
  578. ULONG LIBENT            LT_FixedMult(REG(d0) FIXED fixed,REG(d1) ULONG factor);
  579. LONG LIBENT            LT_LabelWidth(REG(a0) struct LayoutHandle *handle,REG(a1) STRPTR label);
  580. LONG LIBENT            LT_LabelChars(REG(a0) struct LayoutHandle *handle,REG(a1) STRPTR label);
  581. VOID LIBENT            LT_LockWindow(REG(a0) struct Window *window);
  582. VOID LIBENT            LT_UnlockWindow(REG(a0) struct Window *window);
  583. VOID LIBENT            LT_DeleteWindowLock(REG(a0) struct Window *window);
  584. VOID LIBENT            LT_ShowWindow(REG(a0) struct LayoutHandle *handle,REG(a1) BOOL activate);
  585. VOID LIBENT            LT_Activate(REG(a0) struct LayoutHandle *handle,REG(d0) LONG id);
  586. VOID LIBENT            LT_PressButton(REG(a0) struct LayoutHandle *handle,REG(d0) LONG id);
  587. WORD LIBENT            LT_GetCode(REG(d0) ULONG MsgQualifier,REG(d1) ULONG MsgClass,REG(d2) UWORD MsgCode,REG(a0) struct Gadget *MsgGadget);
  588. struct IntuiMessage * LIBENT    LT_GetIMsg(REG(a0) struct LayoutHandle *Handle);
  589. VOID LIBENT            LT_ReplyIMsg(REG(a0) struct IntuiMessage *Msg);
  590. VOID LIBENT            LT_UpdateStrings(REG(a0) struct LayoutHandle *Handle);
  591. VOID LIBENT            LT_DisposeMenu(REG(a0) struct Menu *Menu);
  592. struct Menu * LIBENT        LT_NewMenuTemplate(REG(a0) struct Screen *Screen,REG(a1) struct TextAttr *TextAttr,REG(a2) struct Image *AmigaGlyph,REG(a3) struct Image *CheckGlyph,REG(d0) LONG *Error,REG(d1) struct NewMenu *MenuTemplate);
  593. struct Menu * LIBENT        LT_NewMenuTagList(REG(a0) struct TagItem *TagList);
  594. VOID LIBENT            LT_MenuControlTagList(REG(a0) struct Window *Window,REG(a1) struct Menu *IntuitionMenu,REG(a2) struct TagItem *Tags);
  595. struct MenuItem * LIBENT    LT_GetMenuItem(REG(a0) struct Menu *Menu,REG(d0) ULONG ID);
  596. struct MenuItem * LIBENT    LT_FindMenuCommand(REG(a0) struct Menu *Menu,REG(d0) UWORD MsgCode,REG(d1) UWORD MsgQualifier,REG(a1) struct Gadget *MsgGadget);
  597.  
  598.  
  599. /*****************************************************************************/
  600.  
  601.  
  602. /* For use as link library */
  603.  
  604. BOOL LIBENT            LT_Init(VOID);
  605. VOID LIBENT            LT_Exit(VOID);
  606.  
  607. /* Available for library-internal use and as link library */
  608.  
  609. BOOL __stdargs            LT_RebuildTags(struct LayoutHandle *handle,BOOL clear,...);
  610. struct LayoutHandle * __stdargs    LT_CreateHandleTags(struct Screen *Screen,...);
  611. LONG __stdargs            LT_GetAttributes(struct LayoutHandle *Handle,LONG ID,...);
  612. VOID __stdargs            LT_SetAttributes(struct LayoutHandle *handle,LONG id,...);
  613. VOID __stdargs            LT_AddL(struct LayoutHandle *handle,UBYTE type,ULONG labelID,LONG id,...);
  614. VOID __stdargs            LT_Add(struct LayoutHandle *Handle,UBYTE Type,STRPTR Label,LONG ID,...);
  615. VOID __stdargs            LT_New(struct LayoutHandle *handle,...);
  616. struct Window * __stdargs    LT_Build(struct LayoutHandle *Handle,...);
  617. struct Window * __stdargs    LT_Layout(struct LayoutHandle *handle, STRPTR title,struct IBox *bounds,LONG extraWidth, LONG extraHeight,ULONG IDCMP, UBYTE align, ...);
  618. struct Menu * __stdargs        LT_LayoutMenus(struct LayoutHandle *handle,struct NewMenu *menuTemplate,...);
  619.  
  620. struct Menu * __stdargs        LT_NewMenuTags(Tag FirstTag,...);
  621. VOID __stdargs            LT_MenuControlTags(struct Window *Window,struct Menu *Menu,...);
  622.  
  623.  
  624. /*****************************************************************************/
  625.  
  626.  
  627. /* Useful macros */
  628.  
  629. #define LT_GetString(Handle,Code)    ((STRPTR)LT_GetAttributes((Handle),(Code),TAG_DONE))
  630.  
  631. #define LAMN_Menu_UserData(m)        (*(APTR *)(((struct Menu *)(m)) + 1))
  632. #define LAMN_Menu_ID(m)            (((ULONG *)(((struct Menu *)(m)) + 1))[1])
  633.  
  634. #define LAMN_Item_UserData(m)        (*(APTR *)(((struct MenuItem *)(m)) + 1))
  635. #define LAMN_Item_ID(m)            (((ULONG *)(((struct MenuItem *)(m)) + 1))[1])
  636.  
  637.  
  638. /*****************************************************************************/
  639.  
  640.  
  641. /* Obsolete routines, do not use in new code. */
  642.  
  643. BOOL LIBENT                LT_Rebuild(REG(a0) struct LayoutHandle *handle,REG(a1) struct IBox *bounds,REG(a2) LONG extraWidth,REG(d0) LONG extraHeight,REG(d1) BOOL clear);
  644. struct Window * LIBENT            LT_LayoutA(REG(a0) struct LayoutHandle *handle, REG(a1) STRPTR title,REG(a2) struct IBox *bounds,REG(d0) LONG extraWidth, REG(d1) LONG extraHeight,REG(d2) ULONG IDCMP, REG(d3) UBYTE align, REG(a3) struct TagItem *TagParams);
  645. VOID LIBENT                LT_AddA(REG(a0) struct LayoutHandle *Handle,REG(d0) UBYTE Type,REG(d1) STRPTR Label,REG(d2) LONG ID,REG(a1) struct TagItem *TagList);
  646.  
  647. #define LT_GetDrawInfo(Handle)        (Handle) ? ((Handle) -> DrawInfo)    : NULL
  648. #define LT_GetVisualInfo(Handle)    (Handle) ? ((Handle) -> VisualInfo)    : NULL
  649. #define LT_GetScreen(Handle)        (Handle) ? ((Handle) -> Screen)        : NULL
  650. #define LT_SetAutoActivate(Handle,Mode)    LT_SetAttributes(Handle,0,LH_AutoActivate,Mode,TAG_DONE)
  651.  
  652.  
  653. /*****************************************************************************/
  654.  
  655.  
  656. #if !defined(_GTLAYOUT_GLOBAL_H) && !defined(NO_PRAGMAS)
  657. #pragma libcall GTLayoutBase LT_LevelWidth 1e 2DB10A9808
  658. #pragma libcall GTLayoutBase LT_DeleteHandle 24 801
  659. #pragma libcall GTLayoutBase LT_CreateHandle 2a 9802
  660. #pragma libcall GTLayoutBase LT_CreateHandleTagList 30 9802
  661. #pragma tagcall GTLayoutBase LT_CreateHandleTags 30 9802
  662. #pragma libcall GTLayoutBase LT_Rebuild 36 10A9805
  663. #pragma libcall GTLayoutBase LT_HandleInput 3c BA90805
  664. #pragma libcall GTLayoutBase LT_BeginRefresh 42 801
  665. #pragma libcall GTLayoutBase LT_EndRefresh 48 0802
  666. #pragma libcall GTLayoutBase LT_GetAttributesA 4e 90803
  667. #pragma tagcall GTLayoutBase LT_GetAttributes 4e 90803
  668. #pragma libcall GTLayoutBase LT_SetAttributesA 54 90803
  669. #pragma tagcall GTLayoutBase LT_SetAttributes 54 90803
  670. #pragma libcall GTLayoutBase LT_AddA 5a 9210805
  671. #pragma tagcall GTLayoutBase LT_Add 5a 9210805
  672. #pragma libcall GTLayoutBase LT_NewA 60 9802
  673. #pragma tagcall GTLayoutBase LT_New 60 9802
  674. #pragma libcall GTLayoutBase LT_EndGroup 66 801
  675. #pragma libcall GTLayoutBase LT_LayoutA 6c B3210A9808
  676. #pragma tagcall GTLayoutBase LT_Layout 6c B3210A9808
  677. #pragma libcall GTLayoutBase LT_LayoutMenusA 72 A9803
  678. #pragma tagcall GTLayoutBase LT_LayoutMenus 72 A9803
  679. #pragma libcall GTLayoutBase LT_Fixed2String 78 1002
  680. #pragma libcall GTLayoutBase LT_String2Fixed 7e 801
  681. #pragma libcall GTLayoutBase LT_FixedMult 84 1002
  682. #pragma libcall GTLayoutBase LT_LabelWidth 8a 9802
  683. #pragma libcall GTLayoutBase LT_LabelChars 90 9802
  684. #pragma libcall GTLayoutBase LT_LockWindow 96 801
  685. #pragma libcall GTLayoutBase LT_UnlockWindow 9c 801
  686. #pragma libcall GTLayoutBase LT_DeleteWindowLock a2 801
  687. #pragma libcall GTLayoutBase LT_ShowWindow a8 9802
  688. #pragma libcall GTLayoutBase LT_Activate ae 0802
  689. #pragma libcall GTLayoutBase LT_PressButton b4 0802
  690. #pragma libcall GTLayoutBase LT_GetCode ba 821004
  691. /*--- Added in v1.78 --------------------------------------------------*/
  692. #pragma libcall GTLayoutBase LT_GetIMsg c0 801
  693. #pragma libcall GTLayoutBase LT_ReplyIMsg c6 801
  694. /*--- Added in v3.0 ---------------------------------------------------*/
  695. #pragma libcall GTLayoutBase LT_BuildA cc 9802
  696. #pragma tagcall GTLayoutBase LT_Build cc 9802
  697. #pragma libcall GTLayoutBase LT_RebuildTagList d2 90803
  698. #pragma tagcall GTLayoutBase LT_RebuildTags d2 90803
  699. /*--- Added in v9.0 ---------------------------------------------------*/
  700. #pragma libcall GTLayoutBase LT_UpdateStrings d8 801
  701. /*--- Added in v11.0 ---------------------------------------------------*/
  702. #pragma libcall GTLayoutBase LT_DisposeMenu de 801
  703. #pragma libcall GTLayoutBase LT_NewMenuTemplate e4 10BA9806
  704. #pragma libcall GTLayoutBase LT_NewMenuTagList ea 801
  705. #pragma tagcall GTLayoutBase LT_NewMenuTags ea 801
  706. #pragma libcall GTLayoutBase LT_MenuControlTagList f0 A9803
  707. #pragma tagcall GTLayoutBase LT_MenuControlTags f0 A9803
  708. #pragma libcall GTLayoutBase LT_GetMenuItem f6 0802
  709. #pragma libcall GTLayoutBase LT_FindMenuCommand fc 910804
  710. /*--- Added in v14.0 ---------------------------------------------------*/
  711. #pragma libcall GTLayoutBase LT_NewLevelWidth 102 23B10A9808
  712. #endif    /* !_GTLAYOUT_GLOBAL_H && !NO_PRAGMAS */
  713.  
  714.  
  715. /*****************************************************************************/
  716.  
  717.  
  718. #endif    /* _GTLAYOUT_H */
  719.